package pj.control;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("")
public class SmsController {


    @GetMapping("/api1/sendMsgV3")
    public String sendMsgV3(String msg) throws Exception{

        System.out.println("---------------------------msg:"+msg);

        return "success";
    }

    @GetMapping("/api/sendMsgV3")
    public String sendMsgV(String msg) throws Exception{
        System.out.println("---------------------------msg2:"+msg);
        return "success";
    }



    @GetMapping("/api1/sendMsgV4")
    public String sendMsg4(String msg) throws Exception{
        System.out.println("---------------------------msg2:"+msg);
        String response = "<html>\n" +
                "    <body>\n" +
                "        <h1>OAuth Approval</h1>\n" +
                "        <p>Do you authorize \"1001\" to access your protected resources??这是我的</p>\n" +
                "        <form id=\"confirmationForm\" name=\"confirmationForm\" action=\"/oauth/authorize\" method=\"post\">\n" +
                "            <input name=\"user_oauth_approval\" value=\"true\" type=\"hidden\"/>\n" +
                "            <input type=\"hidden\" name=\"_csrf\" value=\"7e55cb9e-c9d9-4400-a5ef-7546f4588083\"/>\n" +
                "            <ul>\n" +
                "                <li>\n" +
                "                    <div class=\"form-group\">\n" +
                "                        scope.read: <input type=\"radio\" name=\"scope.read\" value=\"true\">Approve</input>\n" +
                "                        <input type=\"radio\" name=\"scope.read\" value=\"false\" checked>Deny</input>\n" +
                "                    </div>\n" +
                "                </li>\n" +
                "                <li>\n" +
                "                    <div class=\"form-group\">\n" +
                "                        scope.write: <input type=\"radio\" name=\"scope.write\" value=\"true\">Approve</input>\n" +
                "                        <input type=\"radio\" name=\"scope.write\" value=\"false\" checked>Deny</input>\n" +
                "                    </div>\n" +
                "                </li>\n" +
                "            </ul>\n" +
                "            <label>\n" +
                "                <input name=\"authorize\" value=\"Authorize\" type=\"submit\"/>\n" +
                "            </label>\n" +
                "        </form>\n" +
                "    </body>\n" +
                "</html>\n";
        return response;
    }

}
